<template>
  <ProductDetail @submit="apply" />
</template>

<script>
import ProductDetail from './productDetail';
import { Dialog } from 'vant';
export default {
  components: {
    [Dialog.Component.name]: Dialog.Component,
    ProductDetail
  },
  methods: {
    apply() {
      if (!this.$store.state.token) {
        Dialog.confirm({
          title: '您还未实名，是否立即进行实名',
          confirmButtonColor: '#f09637',
          confirmButtonText: '立即实名',
          cancelButtonText: '暂不实名'
        }).then(() => {
          this.$router.openPage('/login');
        });
      } else {
        this.$router.openPage(`/electronicInvoiceApply?id=${this.$route.query.id}`);
      }
    }
  }
};
</script>
